﻿@model cloudscribe.Core.IdentityServerIntegration.Models.ApiEditViewModel
@using cloudscribe.Core.IdentityServerIntegration.Models
@using cloudscribe.Core.IdentityServerIntegration
@using Microsoft.Extensions.Localization
@inject IStringLocalizer<CloudscribeIds4Resources> sr
<div class="row">
    <div class="col-md-10 col-md-push-2">
        @if (Model.CurrentApi == null)
        {
            <h2>@ViewData["Title"]</h2>
            await Html.RenderPartialAsync("NewApiPartial", Model.NewApi);
        }
        else
        {
            <h2>@ViewData["Title"]</h2>
            await Html.RenderPartialAsync("EditApiResourcePartial", new ApiItemViewModel(Model.SiteId, Model.CurrentApi));
            await Html.RenderPartialAsync("ApiScopesPartial", Model);
            await Html.RenderPartialAsync("ApiClaimsPartial", Model);
            await Html.RenderPartialAsync("ApiSecretsPartial", Model);
        }
    </div>
    <div class="col-md-2 col-md-pull-10">
        @await Component.InvokeAsync("Navigation", new { viewName = "SideNavAlt1", filterName = NamedNavigationFilters.ParentTree, startingNodeKey = "SiteAdmin" })
    </div>
</div>
@section Scripts {
@{ await Html.RenderPartialAsync("_SideMenuScriptsPartial"); }
@{await Html.RenderPartialAsync("_UnobtrusiveValidationScriptsPartial"); }
}
